package com.peak.spring.boot.api.web;

import java.util.List;
import java.util.Map;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.peak.spring.boot.api.constant.Constants;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class TreeVo extends IdVo {

	private static final long serialVersionUID = Constants.SERIAL_VERSION;

	private String text;

	private String icon;

	private String href;

	private String lineNo;

	private List<TreeVo> nodes;

	private Map<String, Object> attributes = Maps.newHashMap();

	public TreeVo addNode(TreeVo node) {
		if (this.nodes == null) {
			this.nodes = Lists.newArrayList();
		}
		this.nodes.add(node);
		return this;
	}

}
